package com.common.constants.code;

public class ResultCode {

	/**
	 * 正常
	 */
	public final static ResultCode NORMAL = new ResultCode("NM000000", "NORMAL", "正常", 0);

	/**
	 * 系统错误！
	 */
	public final static ResultCode ERROR_SYSTEM = new ResultCode("ERR99999", "ERROR_SYSTEM", "系统错误！", 1);
	
	/**
	 * 接口请求参数解码错误！
	 */
	public final static ResultCode ERROR_SYSTEM_REQUEST_PARAM_DECODE = new ResultCode("PRM000001", "ERROR_SYSTEM_REQUEST_PARAM_DECODE", "接口请求参数解码错误！", 2);

	/**
	 * 请求出错，请检查您传入的参数格式是否正确
	 */
	public final static ResultCode ERROR_SYSTEM_PARAM_FORMAT = new ResultCode("PRM000002", "ERROR_SYSTEM_PARAM_FORMAT", "请求出错，请检查您传入的参数格式是否正确", 2);

	/**
	 * 参数不能为空
	 */
	public final static ResultCode ERROR_SYSTEM_PARAM_CANNOT_EMPTY = new ResultCode("PRM000003", "ERROR_SYSTEM_PARAM_CANNOT_EMPTY", "参数不能为空！", 2);

	/**
	 * 参数必须为数值类型
	 */
	public final static ResultCode ERROR_SYSTEM_PARAM_NOT_NUMERIC = new ResultCode("PRM000005", "ERROR_SYSTEM_PARAM_NOT_NUMERIC", "参数必须为数值类型", 2);

	/**
	 * 手机号非法
	 */
	public final static ResultCode ERROR_SYSTEM_MOBILE_INVALID = new ResultCode("PRM000006", "ERROR_SYSTEM_MOBILE_INVALID", "手机号非法", 2);

	/**
	 * 固定电话号码非法
	 */
	public final static ResultCode ERROR_SYSTEM_PHONE_INVALID = new ResultCode("PRM000010", "ERROR_SYSTEM_PHONE_INVALID", "固定电话号码非法", 2);

	/**
	 * 邮箱地址非法
	 */
	public final static ResultCode ERROR_SYSTEM_EMAIL_INVALID = new ResultCode("PRM000007", "ERROR_SYSTEM_EMAIL_INVALID", "邮箱地址非法", 2);

	/**
	 * 身份证号码非法
	 */
	public final static ResultCode ERROR_SYSTEM_IDENTITY_INVALID = new ResultCode("PRM000008", "ERROR_SYSTEM_IDENTITY_INVALID", "身份证号码不正确！", 2);

    /**
     * 密码低于6位
     */
    public final static ResultCode ERROR_SYSTEM_PASSWORD_INVALID = new ResultCode("PRM000009", "ERROR_SYSTEM_PASSWORD_INVALID", "密码低于6位！", 2);

	/**
	 * boolean类型参数非法
	 */
	public final static ResultCode ERROR_SYSTEM_BOOLEAN_INVALID
			= new ResultCode("PRM000010", "ERROR_SYSTEM_BOOLEAN_INVALID", "boolean类型参数非法！", 2);
	//错误描述信息
    protected String msg;
	//代码标号
	protected String code;
	//代码串
	protected String codeStr;

	/**
	 * 错误类型（0:一般结果码；1：系统级的错误；2：应用级的错误）
	 */
	protected int type;

	public String getCode() {
		return this.code;
	}

	public String getMsg() {
		return this.msg;
	}

	public String getCodeStr() {
		return this.codeStr;
	}

	public int getType() {
		return this.type;
	}

	public ResultCode() {
	}

	public ResultCode(String code, String codeStr, String msg, int type) {
		this.msg = msg;
		this.code = code;
		this.codeStr = codeStr;
		this.type = type;
	}

}
